package com.study.design.pattern.pattern.behavioral.state;

/**
 * @Author: gongsl
 * @Date: 2025-03-29 21:50
 */
public class OrderSystemTest {
    public static void main(String[] args) {
        OrderContext order = new OrderContext("ORDER_001");
        order.ship();   // 错误：未支付订单不能发货
        order.pay();    // 支付成功
        order.ship();   // 发货成功
        order.cancel(); // 错误：已发货不能取消
        order.receive();// 确认收货
    }
}
